import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Login from '../views/Login.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    children: [
      {
        path: '/home',
        redirect: '/home/shou'
      },
      {
        path: '/home/shou',
        name: 'Shou',
        component: () => import('../views/Shou.vue')
      },
      {
        path: '/home',
        name: 'Home',
        component: () => import('../views/Home.vue')
      },
      {
        path: '/home/find',
        name: 'FindHouse',
        component: () => import('../views/FindHouse.vue')
      },
      {
        path: '/home/fabu',
        name: 'FaBu',
        component: () => import('../views/FaBu.vue')
      },
      {
        path: '/home/message',
        name: 'Message',
        component: () => import('../views/Message.vue')
      },
      {
        path: '/home/my',
        name: 'My',
        component: () => import('../views/My.vue')
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/zu',
    name: 'Zu',
    component: () => import('../views/menus/Zu.vue')
  },
  {
    path: '/qiuzu',
    name: 'QiuZu',
    component: () => import('../views/menus/QiuZu.vue')
  },
  {
    path: '/qiugou',
    name: 'QiuGou',
    component: () => import('../views/menus/QiuGou.vue')
  },
  {
    path: '/map',
    name: 'Map',
    component: () => import('../views/menus/Map.vue')
  },
  {
    path: '/zixun',
    name: 'ZiXun',
    component: () => import('../views/menus/ZiXun.vue')
  },
  {
    path: '/loushi',
    name: 'LouShi',
    component: () => import('../views/menus/LouShi.vue')
  },
  {
    path: '/people',
    name: 'People',
    component: () => import('../views/menus/People.vue')
  },
  {
    path: '/tuangou',
    name: 'TuanGou',
    component: () => import('../views/menus/TuanGou.vue')
  },
  {
    path: '/zhibo',
    name: 'ZhiBo',
    component: () => import('../views/menus/ZhiBo.vue')
  },
  {
    path: '/twomore',
    name: 'TwoMore',
    component: () => import('../views/TwoMore.vue')
  },
  {
    path: '/redoor',
    name: 'ReDoor',
    component: () => import('../views/ReDoor.vue')
  },
  {
    path: '/detail/:id',
    name: 'Detail',
    component: () => import('../views/Detail.vue')
  },
  {
    path: '/cang',
    name: 'Cang',
    component: () => import('../views/Cang.vue')
  },
  {
    path: '/history',
    name: 'History',
    component: () => import('../views/History.vue')
  },
  {
    path: '/pay',
    name: 'Pay',
    component: () => import('../views/wode/Pay.vue')
  },
  {
    path: '/quest',
    name: 'Quest',
    component: () => import('../views/wode/Quest.vue')
  },
  {
    path: '/lianxi',
    name: 'LianXi',
    component: () => import('../views/wode/LianXi.vue')
  },
  {
    path: '/hudong',
    name: 'HuDong',
    component: () => import('../views/messages/HuDong.vue')
  },
  {
    path: '/xitong',
    name: 'XiTong',
    component: () => import('../views/messages/XiTong.vue')
  },
  {
    path: '/city',
    name: 'City',
    component: () => import('../views/City.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
